﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using V5_Common;

namespace V5_EShop.includes {
    /// <summary>
    /// Image 的摘要说明
    /// </summary>
    public class Image : IHttpHandler {

        HttpContext context;
        public void ProcessRequest(HttpContext _context) {
            context = _context;
            string file = context.Request["file"];
            string size = context.Request["size"];
            string path = context.Server.MapPath("~/") + file;
            string[] sizeArr = size.Split(new string[] { "x" }, StringSplitOptions.None);
            ImageHelper.ImageResponse(path, int.Parse(sizeArr[0]), int.Parse(sizeArr[1]), "", "", "W");
        }

        public bool IsReusable {
            get {
                return false;
            }
        }
    }
}